<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>

    <title>教师模块</title>
    <!-- Bootstrap core CSS -->
    <link href="../static/asserts/css/bootstrap.min.css" th:href="@{/asserts/css/bootstrap.min.css}" rel="stylesheet">
    <script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.js"></script>
    <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.css" rel="stylesheet">
    <!-- Custom styles for this template -->
    <link href="../static/asserts/css/dashboard.css" th:href="@{/asserts/css/dashboard.css}" rel="stylesheet">
    <style type="text/css">
        /* Chart.js */

        @-webkit-keyframes chartjs-render-animation {
            from {
                opacity: 0.99
            }
            to {
                opacity: 1
            }
        }

        @keyframes chartjs-render-animation {
            from {
                opacity: 0.99
            }
            to {
                opacity: 1
            }
        }

        .chartjs-render-monitor {
            -webkit-animation: chartjs-render-animation 0.001s;
            animation: chartjs-render-animation 0.001s;
        }
    </style>
</head>

<body>
<div th:replace="sidbar::#topbar"></div>

<div class="container-fluid">
    <div class="row">
        <div th:replace="sidbar::#sbar(activeUri='main.html')"></div>

        <main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
            <div class="chartjs-size-monitor"
                 style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px; overflow: hidden; pointer-events: none; visibility: hidden; z-index: -1;">
                <div class="chartjs-size-monitor-expand"
                     style="position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1;">
                    <div style="position:absolute;width:1000000px;height:1000000px;left:0;top:0"></div>
                </div>
                <div class="chartjs-size-monitor-shrink"
                     style="position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1;">
                    <div style="position:absolute;width:200%;height:200%;left:0; top:0"></div>
                </div>
            </div>
            <div class="row">
                <div class="col-md-4  ">
                    <a class="btn btn-primary"  shiro:authenticated
                       th:href="@{/selTogeTea(id=${session.teaAll.getId()})}">和我共事的老师</a>

					 <form th:action="@{/selectPerms}" shiro:hasPermission="root">
                  <select class="col-md-5" name="perms" >
                        <option th:text="管理员" value="root" th:selected="${perms=='root'}" ></option>
                        <option th:text="游客" value="yk" th:selected="${perms=='yk'}" ></option>
                        <option th:text="教师" value="teacher" th:selected="${perms=='teacher'}" ></option>
                    </select>
                    <input type="submit" class="btn-success" th:value="根据权限查找">
                </form>
				</div>
                <div class="col-md-1 col-md-offset-1">
                    <a class="btn btn-info" th:href="@{/selCoAll}">查看全部老师</a>
                </div>
                <div class="col-md-5 col-md-offset-1">
                    <form th:action="@{/selectTeaByName}" method="post">
                        教师名字：<input type="text" name="name">
                        <input type="submit" value="查询" class="btn btn-success">
                    </form>
                </div>
            </div>

            <div th:if="${type==null}"
                 style="font-size: large;text-align: center;border: 1px gray solid;background: #d2ffa9">
                [[${iud}]]成功！教师信息： <br>
                教师编号：
                <div th:text="${teacher.getId()}"></div>
                <br>
                教师名字：
                <div th:text="${teacher.getName()}"></div>
                <br>
                教师年龄：
                <div th:text="${teacher.getAge()}"></div>
                <br>
                教师帐号
                <div th:text="${teacher.getZh()}"></div>
                <br>
                <div th:text="${teacher.getSex()==1?'性别：男':'性别：女'}"></div>
                <br>
            </div>

            <div id="bodyy" th:if="${type!=null}">
                <!--                    <button id="btn" th:onclick="stu(1)">bb</button>-->
                <table class="table table-bordered">
                    <thead>
                    <tr>
                        <th>老师编号</th>
                        <th>老师名字</th>
                        <th>年龄</th>
                        <th>性别</th>
                        <th shiro:hasPermission="root">操作</th>
                        <th>详细信息</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="its:${pageInfo.list}">
                        <td th:text="${its.getId()}">老师编号</td>
                        <td><a class="btn btn-outline-primary" th:href="@{/teaMe(id=${its.getId()})}"
                               th:text="${its.getName()}"></a></td>
                        <td th:text="${its.getAge()}">年龄</td>
                        <td th:text="${its.getSex()==1?'男':'女'}">性别</td>
                        <td class="warning" shiro:hasPermission="root"><a class="btn btn-outline-warning"
                                                                          th:href="@{/toSetTC(id=${its.getId()})}">修改班级联系</a>
                            &nbsp; |&nbsp;<a class="btn btn-outline-danger" th:href="@{/deleteTea(id=${its.getId()})}"
                                             th:title="会同时删除该老师和班级的链接关系">删除</a></td>
                        <td><a class="btn btn-outline-info" th:href="@{/teaMe(id=${its.getId()})}">详情</a></td>
                    </tr>
                    </tbody>
                </table>

                <div class="col-md-2">
                    当前[[${pageInfo.pageNum}]]页,总共[[${pageInfo.pages}]]页,总[[${pageInfo.total}]]条记录
                </div>
                <!--						查看全部老师-->
                <nav th:if="${type=='all'}" aria-label="Page navigation" style="text-align: center">
                    <ul class="pagination pagination-lg">
                        <li>
                            <a th:href="@{/selCoAll(pageNum=1)}"
                               aria-label="Next">
                                <span aria-hidden="true">首页</span>
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/selCoAll(pageNum=${pageInfo.pageNum -1})}" aria-label="Next">
                                <span aria-hidden="true">&laquo;</span>
                            </a>
                        </li>
                    </ul>
                    <ul class="pagination pagination-lg" th:each="na:${pageInfo.navigatepageNums}">
                        <li><a th:href="@{/selCoAll(pageNum=${na})}" th:if="${pageInfo.pageNum!=na}"
                               th:text="${na}"></a></li>
                        <li th:class="active"><a th:class="active" th:href="@{#}" th:if="${pageInfo.pageNum==na}"
                                                 th:text="${na}"></a></li>
                    </ul>
                    <ul class="pagination pagination-lg">
                        <li>
                            <a th:href="@{/selCoAll(pageNum=${pageInfo.pageNum +1})}" aria-label="Next">
                                <span aria-hidden="true">&raquo;</span>
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/selCoAll(pageNum=${pageInfo.pages})}"
                               aria-label="Next">
                                <span aria-hidden="true">末页</span>
                            </a>
                        </li>
                    </ul>
                </nav>


                <!--						查看同班老师-->
                <nav th:if="${type=='toge'}" aria-label="Page navigation" style="text-align: center">
                    <ul class="pagination pagination-lg">
                        <li>
                            <a th:href="@{/selTogeTea(id=${session.teaAll.getId()},pageNum=1)}"
                               aria-label="Next">
                                <span aria-hidden="true">首页</span>
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/selTogeTea(id=${session.teaAll.getId()},pageNum=${pageInfo.pageNum -1})}"
                               aria-label="Next">
                                <span aria-hidden="true">&laquo;</span>
                            </a>
                        </li>
                    </ul>
                    <ul class="pagination pagination-lg" th:each="na:${pageInfo.navigatepageNums}">
                        <li><a th:href="@{/selTogeTea(id=${session.teaAll.getId()},pageNum=${na})}"
                               th:if="${pageInfo.pageNum!=na}"
                               th:text="${na}"></a></li>
                        <li th:class="active"><a th:class="active" th:href="@{#}" th:if="${pageInfo.pageNum==na}"
                                                 th:text="${na}"></a></li>
                    </ul>
                    <ul class="pagination pagination-lg">
                        <li>
                            <a th:href="@{/selTogeTea(id=${session.teaAll.getId()},pageNum=${pageInfo.pageNum +1})}"
                               aria-label="Next">
                                <span aria-hidden="true">&raquo;</span>
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/selTogeTea(id=${session.teaAll.getId()},pageNum=${pageInfo.pages})}"
                               aria-label="Next">
                                <span aria-hidden="true">末页</span>
                            </a>
                        </li>
                    </ul>
                </nav>


                <!--						查询名字的老师-->
                <nav th:if="${type=='name'}" aria-label="Page navigation" style="text-align: center">
                    <ul class="pagination pagination-lg">
                        <li>
                            <a th:href="@{/selTogeTea(name=${name1},pageNum=1)}"
                               aria-label="Next">
                                <span aria-hidden="true">首页</span>
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/selTogeTea(name=${name1},pageNum=${pageInfo.pageNum -1})}" aria-label="Next">
                                <span aria-hidden="true">&laquo;</span>
                            </a>
                        </li>
                    </ul>
                    <ul class="pagination pagination-lg" th:each="na:${pageInfo.navigatepageNums}">
                        <li><a th:href="@{/selTogeTea(name=${name1},pageNum=${na})}" th:if="${pageInfo.pageNum!=na}"
                               th:text="${na}"></a></li>
                        <li th:class="active"><a th:class="active" th:href="@{#}" th:if="${pageInfo.pageNum==na}"
                                                 th:text="${na}"></a></li>
                    </ul>
                    <ul class="pagination pagination-lg">
                        <li>
                            <a th:href="@{/selTogeTea(name=${name1},pageNum=${pageInfo.pageNum +1})}" aria-label="Next">
                                <span aria-hidden="true">&raquo;</span>
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/selTogeTea(name=${name1},pageNum=${pageInfo.pages})}"
                               aria-label="Next">
                                <span aria-hidden="true">末页</span>
                            </a>
                        </li>
                    </ul>
                </nav>

                <!--						查询权限的老师-->
                <nav th:if="${type=='perms'}" aria-label="Page navigation" style="text-align: center">
                    <ul class="pagination pagination-lg">
                        <li>
                            <a th:href="@{/selectPerms(perms=${perms},pageNum=1)}"
                               aria-label="Next">
                                <span aria-hidden="true">首页</span>
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/selectPerms(perms=${perms},pageNum=${pageInfo.pageNum -1})}"
                               aria-label="Next">
                                <span aria-hidden="true">&laquo;</span>
                            </a>
                        </li>
                    </ul>
                    <ul class="pagination pagination-lg" th:each="na:${pageInfo.navigatepageNums}">
                        <li><a th:href="@{/selectPerms(perms=${perms},pageNum=${na})}" th:if="${pageInfo.pageNum!=na}"
                               th:text="${na}"></a></li>
                        <li th:class="active"><a th:class="active" th:href="@{#}" th:if="${pageInfo.pageNum==na}"
                                                 th:text="${na}"></a></li>
                    </ul>
                    <ul class="pagination pagination-lg">
                        <li>
                            <a th:href="@{/selectPerms(perms=${perms},pageNum=${pageInfo.pageNum +1})}"
                               aria-label="Next">
                                <span aria-hidden="true">&raquo;</span>
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/selectPerms(perms=${perms},pageNum=${pageInfo.pages})}"
                               aria-label="Next">
                                <span aria-hidden="true">末页</span>
                            </a>
                        </li>
                    </ul>
                </nav>
            </div>

        </main>
    </div>
</div>


</body>

</html>